/*
 * @Author: wangqizhang
 * @Date: 2024-04-26 15:37:48
 * @LastEditors: wangqizhang
 * @LastEditTime: 2024-05-05 17:50:12
 * @FilePath: /suixinji-server/model/user.model.js
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
const { DataTypes } = require('sequelize');
const seq = require('../db/connect');
const userParams = {
  user_name: {
    type: DataTypes.CHAR(20),
    allowNull: false,
    unique: true,
    comment: '用户名, 唯一',
    required: true,
    // validate: {
    //   args: [5],
    //   msg: '用户名长度不能小于5位',
    // },
  },
  pass_word: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false,
    comment: '密码',
    required: true,
    // validate: {
    //   args: [255],
    //   msg: '密码长度不能小于8位',
    // },
  },
};
const User = seq.define('db_user', userParams);
User.sync({ force: false });
module.exports = { User, userParams };
